home *** CD-ROM | disk | FTP | other *** search
-
-
-
- aaaappppxxxxssss((((8888)))) UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV ((((AAAApppprrrriiiillll 1111999999998888)))) aaaappppxxxxssss((((8888))))
-
-
-
- NNNNAAAAMMMMEEEE
- apxs - APache eXtenSion tool
-
- SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
- aaaappppxxxxssss ----gggg ----nnnn _m_o_d_n_a_m_e
-
- aaaappppxxxxssss ----qqqq _q_u_e_r_y ...
-
- aaaappppxxxxssss ----cccc [ ----oooo _d_s_o_f_i_l_e ] [ ----IIII _i_n_c_d_i_r ] [ ----DDDD _n_a_m_e=_v_a_l_u_e ] [ ----LLLL
- _l_i_b_d_i_r ] [ ----llll _l_i_b_n_a_m_e ] [ ----WWWWcccc,,,,_c_o_m_p_i_l_e_r-_f_l_a_g_s ] [
- ----WWWWllll,,,,_l_i_n_k_e_r-_f_l_a_g_s ] _f_i_l_e_s ...
-
- aaaappppxxxxssss ----iiii [ ----nnnn _m_o_d_n_a_m_e ] [ ----aaaa ] [ ----AAAA ] _d_s_o_f_i_l_e ...
-
- DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
- aaaappppxxxxssss is a tool for building and installing extension modules
- for the Apache HyperText Transfer Protocol (HTTP) server.
- This is achieved by building a dynamic shared object (DSO)
- from one or more source or object _f_i_l_e_s which then can be
- loaded into the Apache server under runtime via the
- LLLLooooaaaaddddMMMMoooodddduuuulllleeee directive from mmmmoooodddd____ssssoooo....
-
- So to use this extension mechanism your platform has to
- support the DSO feature and your Apache hhhhttttttttppppdddd binary has to
- be built with the mmmmoooodddd____ssssoooo module. The aaaappppxxxxssss tool
- automatically complains if this is not the case. You can
- check this yourself by manually running the command
-
- $ httpd -l
-
- The module mmmmoooodddd____ssssoooo should be part of the displayed list. If
- these requirements are fulfilled you can easily extend your
- Apache server's functionality by installing your own modules
- with the DSO mechanism by the help of this aaaappppxxxxssss tool:
-
- $ apxs -i -a -c mod_foo.c
- gcc -fpic -DSHARED_MODULE -I/path/to/apache/include -c mod_foo.c
- ld -Bshareable -o mod_foo.so mod_foo.o
- cp mod_foo.so /path/to/apache/libexec/mod_foo.so
- chmod 755 /path/to/apache/libexec/mod_foo.so
- [activating module `foo' in /path/to/apache/etc/httpd.conf]
- $ apachectl restart
- /path/to/apache/sbin/apachectl restart: httpd not running, trying to start
- [Tue Mar 31 11:27:55 1998] [debug] mod_so.c(303): loaded module foo_module
- /path/to/apache/sbin/apachectl restart: httpd started
- $ _
-
- The arguments _f_i_l_e_s can be any C source file (.c), a object
- file (.o) or even a library archive (.a). The aaaappppxxxxssss tool
- automatically recognizes these extensions and automtaically
- used the C source files for compilation while just using the
- object and archive files for the linking phase. But when
-
-
-
- Page 1 (printed 5/3/99)
-
-
-
-
-
-
- aaaappppxxxxssss((((8888)))) UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV ((((AAAApppprrrriiiillll 1111999999998888)))) aaaappppxxxxssss((((8888))))
-
-
-
- using such pre-compiled objects make sure they are compiled
- for position independend code (PIC) to be able to use them
- for a dynamically loaded shared object. For instance with
- GCC you always just have to use ----ffffppppiiiicccc. For other C
- compilers consult its manual page or at watch for the flags
- aaaappppxxxxssss uses to compile the object files.
-
- For more details about DSO support in Apache read the
- documentation of mmmmoooodddd____ssssoooo or perhaps even read the
- ssssrrrrcccc////mmmmoooodddduuuulllleeeessss////ssssttttaaaannnnddddaaaarrrrdddd////mmmmoooodddd____ssssoooo....cccc source file.
-
-
- OOOOPPPPTTTTIIIIOOOONNNNSSSS
- Common options:
-
- ----nnnn _m_o_d_n_a_m_e This explicitly sets the module name for the ----iiii
- (install) and ----gggg (template generation) option.
- Use this to explicitly specify the module name.
- For option ----gggg this is required, for option ----iiii
- the aaaappppxxxxssss tool tries to determine the name from
- the source or (as a fallback) at least by
- guessing it from the filename.
-
- Query options:
-
- ----qqqq Performs a query for aaaappppxxxxssss's knowledge about
- certain settings. The _q_u_e_r_y parameters can be
- one or more of the following strings:
- CC TARGET
- CFLAGS SBINDIR
- CFLAGS_SHLIB INCLUDEDIR
- LD_SHLIB LIBEXECDIR
- LDFLAGS_SHLIB SYSCONFDIR
- LIBS_SHLIB
- Use this for manually determining settings. For
- instance use
- INC=-I`apxs -q INCLUDEDIR`
- inside your own Makefiles if you need manual
- access to Apache's C header files.
-
- Template Generation options:
-
- ----gggg This generates a subdirectory _n_a_m_e (see option
- ----nnnn) and there two files: A sample module source
- file named mmmmoooodddd_____n_a_m_e._c which can be used as a
- template for creating your own modules or as a
- quick start for playing with the APXS mechanism.
- And a corresponding MMMMaaaakkkkeeeeffffiiiilllleeee for even easier
- build and installing of this module.
-
- DSO compilation options:
-
-
-
-
- Page 2 (printed 5/3/99)
-
-
-
-
-
-
- aaaappppxxxxssss((((8888)))) UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV ((((AAAApppprrrriiiillll 1111999999998888)))) aaaappppxxxxssss((((8888))))
-
-
-
- ----cccc This indicates the compilation operation. It
- first compiles the C source files (.c) of _f_i_l_e_s
- into corresponding object files (.o) and then
- builds a dynamically shared object in _d_s_o_f_i_l_e by
- linking these object files plus the remaining
- object files (.o and .a) of _f_i_l_e_s If no ----oooo
- option is specified the output file is guessed
- from the first filename in _f_i_l_e_s and thus
- usually defaults to mmmmoooodddd_____n_a_m_e._s_o
-
- ----oooo _d_s_o_f_i_l_e Explicitly specifies the filename of the created
- dynamically shared object. If not specified and
- the name cannot be guessed from the _f_i_l_e_s list,
- the fallback name mmmmoooodddd____uuuunnnnkkkknnnnoooowwwwnnnn....ssssoooo is used.
-
- ----DDDD _n_a_m_e=_v_a_l_u_e
- This option is directly passed through to the
- compilation command(s). Use this to add your
- own defines to the build process.
-
- ----IIII _i_n_c_d_i_r This option is directly passed through to the
- compilation command(s). Use this to add your
- own include directories to search to the build
- process.
-
- ----LLLL _l_i_b_d_i_r This option is directly passed through to the
- linker command. Use this to add your own
- library directories to search to the build
- process.
-
- ----llll _l_i_b_n_a_m_e This option is directly passed through to the
- linker command. Use this to add your own
- libraries to search to the build process.
-
- ----WWWWcccc,,,,_c_o_m_p_i_l_e_r-_f_l_a_g_s
- This option passes _c_o_m_p_i_l_e_r-_f_l_a_g_s as additional
- flags to the compiler command. Use this to add
- local compiler-specific options.
-
- ----WWWWllll,,,,_l_i_n_k_e_r-_f_l_a_g_s
- This option passes _l_i_n_k_e_r-_f_l_a_g_s as additional
- flags to the linker command. Use this to add
- local linker-specific options.
-
- DSO installation options:
-
- ----iiii This indicates the installation operartion and
- installs one or more dynamically shared objects
- into the servers _l_i_b_e_x_e_c directory.
-
- ----aaaa This additionally activates the module by
- automatically adding a corresponding LLLLooooaaaaddddMMMMoooodddduuuulllleeee
-
-
-
- Page 3 (printed 5/3/99)
-
-
-
-
-
-
- aaaappppxxxxssss((((8888)))) UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV ((((AAAApppprrrriiiillll 1111999999998888)))) aaaappppxxxxssss((((8888))))
-
-
-
- line to Apache's hhhhttttttttppppdddd....ccccoooonnnnffff configuration file
- (only if still no such entry exists).
-
- ----AAAA Same as option ----aaaa but the created LLLLooooaaaaddddMMMMoooodddduuuulllleeee
- directive is prefixed with a hash sign (#), i.e.
- the module is just prepared for later activation
- but initially disabled.
-
- EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS
- Assume you have an Apache module named mod_foo.c available
- which should extend Apache's server functionality. To
- accomplish this you first have to compile the C source into
- a shared object suitable for loading into the Apache server
- under runtime via the following command:
-
- $ apxs -c mod_foo.c
- gcc -fpic -DSHARED_MODULE -I/path/to/apache/include -c mod_foo.c
- ld -Bshareable -o mod_foo.so mod_foo.o
- $ _
-
- Then you have to update the Apache configuration by making
- sure a LLLLooooaaaaddddMMMMoooodddduuuulllleeee directive is present to load this shared
- object. To simplify this step aaaappppxxxxssss provides an automatic way
- to install the shared object in its "libexec" directory and
- updating the hhhhttttttttppppdddd....ccccoooonnnnffff file accordingly. This can be
- achieved by running:
-
- $ apxs -i -a mod_foo.c
- cp mod_foo.so /path/to/apache/libexec/mod_foo.so
- chmod 755 /path/to/apache/libexec/mod_foo.so
- [activating module `foo' in /path/to/apache/etc/httpd.conf]
- $ _
-
- This way a line named
-
- LoadModule foo_module libexec/mod_foo.so
-
- is added to the configuration file if still not present. If
- you want to have this this disabled per default use the ----AAAA
- option, i.e.
-
- $ apxs -i -A mod_foo.c
-
- For a quick test of the APXS mechanism you can create a
- sample Apache module template plus a corresponding Makefile
- via:
-
- $ apxs -g -n foo
- Creating [DIR] foo
- Creating [FILE] foo/Makefile
- Creating [FILE] foo/mod_foo.c
- $ _
-
-
-
- Page 4 (printed 5/3/99)
-
-
-
-
-
-
- aaaappppxxxxssss((((8888)))) UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV ((((AAAApppprrrriiiillll 1111999999998888)))) aaaappppxxxxssss((((8888))))
-
-
-
- Then you can immediately compile this sample module into a
- shared object and load it into the Apache server:
-
- $ cd foo
- $ make all reload
- apxs -c mod_foo.c
- gcc -fpic -DSHARED_MODULE -I/path/to/apache/include -c mod_foo.c
- ld -Bshareable -o mod_foo.so mod_foo.o
- apxs -i -a -n "foo" mod_foo.so
- cp mod_foo.so /path/to/apache/libexec/mod_foo.so
- chmod 755 /path/to/apache/libexec/mod_foo.so
- [activating module `foo' in /path/to/apache/etc/httpd.conf]
- apachectl restart
- /path/to/apache/sbin/apachectl restart: httpd not running, trying to start
- [Tue Mar 31 11:27:55 1998] [debug] mod_so.c(303): loaded module foo_module
- /path/to/apache/sbin/apachectl restart: httpd started
- $ _
-
- You can even use aaaappppxxxxssss to compile complex modules outside the
- Apache source tree, like PHP3:
-
- $ cd php3
- $ ./configure --with-shared-apache=../apache-1.3
- $ apxs -c -o libphp3.so mod_php3.c libmodphp3-so.a
- gcc -fpic -DSHARED_MODULE -I/tmp/apache/include -c mod_php3.c
- ld -Bshareable -o libphp3.so mod_php3.o libmodphp3-so.a
- $ _
-
- because aaaappppxxxxssss automatically recognized C source files and
- object files. Only C source files are compiled while
- remaining object files are used for the linking phase.
-
-
- SSSSEEEEEEEE AAAALLLLSSSSOOOO
- aaaappppaaaacccchhhheeeeccccttttllll((((1111)))),,,, hhhhttttttttppppdddd((((8888))))....
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Page 5 (printed 5/3/99)
-
-
-
-